import {createApp} from 'vue'
import App from './App.vue'
import router from "./router";
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import axios from "axios";
import store from './store'
import 'moment/locale/zh-cn';

//中文时间

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
	app.component(key, component)
}

app.use(router)
app.use(ElementPlus)
app.use(store)
app.provide('$axios', axios)
app.mount('#app')




const  whileList=['/']
router.beforeEach((to,from,next)=>{
	if (to.fullPath=="/"){
		next()
	}else if ((localStorage.getItem('token')!=null)&&(localStorage.getItem('openid')!=null)){
		next()
	}else {
		next('/')
	}

})
